package com.zxl.register.base;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * 操作结果
 */
@Data
@Builder
public class Result implements Serializable{

    /**
     * 操作结果  true:成功， false；失败
     */
    private boolean success;

    /**
     * 描述信息
     */
    private String msg;

    /**
     * 额外数据
     */
    private Object data;

    public static Result processSuccess(String msg,Object data){
        return Result.builder().msg(msg).data(data).success(true).build();
    }


    public static Result processFail(String msg,Object data){
        return Result.builder().msg(msg).data(data).success(false).build();
    }

}
